home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / patches / patchemu.lha / patchemu.rexx
OS/2 REXX Batch file  |  1995-11-08  |  1KB  |  56 lines

  1. /* Patch emu object V1.0 */
  2. /* © by Stefan Haubenthal 1995 */
  3. /* 030/25 needs 188 seconds */
  4. /* Chamäleon II:
  5.  
  6.                  AUTOREN
  7.      Thomas Wieger & Thorsten Deuter
  8.  
  9.           Oberfläche mit R.C.T.
  10.  
  11.        © MAXON Computer GmbH 1991
  12.            Industriestraße 26
  13.               6236 Eschborn
  14.           Telefon: 06196/481811
  15.             FAX: 06196/41137
  16.  
  17. (Don't use tools like PrepareEmul) */
  18. name="emu.obj"
  19. len=28504 /* 35000 */
  20. key="BW"
  21. call open in,name
  22. call open out,"t:"name,W
  23. call code(1)
  24. file=out
  25. call patch(x2d(580),"888"x)
  26. call close out
  27. call close in
  28.  
  29. key="BW"
  30. call open in,"t:"name
  31. call open out,name,W
  32. call code(0)
  33. queue "delete >nil: t:"name
  34. exit
  35.  
  36. CODE:
  37. arg decode
  38. do len/2
  39.     word=readch(in,2)
  40.     call writech out,bitxor(word,key)
  41.     if decode then key=reverse(bitxor(word,reverse(key)))
  42.               else key=reverse(bitxor(word,bitxor(key,reverse(key))))
  43. end
  44. return
  45.  
  46. PATCH:
  47. parse arg position,data
  48. if position<0 then exit 10
  49. call seek(file,position,'B')
  50. say c2x(readch(file,length(data)))
  51. call seek(file,-length(data))
  52. call writech(file,data)
  53. call seek(file,-length(data))
  54. say c2x(readch(file,length(data)))
  55. return
  56.